package cn.com.zero.base.exception;

import org.springframework.lang.Nullable;

/**
 * @author zhoupeng
 * @version 1.0.0
 * @Description
 * @createTime 2022-07-11
 */
public class ErrorCodeException extends RuntimeException {

    /**
     * 错误码
     */
    private long code;

    /**
     * 消息参数
     */
    private String[] args;

    public ErrorCodeException(long code) {
        this(code, null, null);
    }

    public ErrorCodeException(long code, @Nullable String[] args) {
        this(code, args, null);
    }

    public ErrorCodeException(long code, @Nullable String[] args, @Nullable String message) {
        super(message == null ? "发生自定义返回码异常" : message);
        this.code = code;
        this.args = args;
    }

    public long getCode() {
        return code;
    }

    public void setCode(long code) {
        this.code = code;
    }

    public String[] getArgs() {
        return args;
    }

    public void setArgs(String[] args) {
        this.args = args;
    }
}
